<?php
/**
 *      [迷你云] (C)2009-2012 南京恒为网络科技.
 *   软件仅供研究与学习使用，如需商用，请访问www.miniyun.cn获得授权
 * 
 */
?>
<?php

class TrashList extends FillBase
{

    
    public function obtainTrashList($user_id, $limit, $start){
        $list =  UserFile::model()->findAllBySql("select * from ".Yii::app()->params['tablePrefix']."files where is_deleted=1 and user_id=".$user_id." and parent_file_id not in (select id from ".Yii::app()->params['tablePrefix']."files where is_deleted=1 and user_id=".$user_id.") order by updated_at desc limit ".$start.", ".$limit);
        $data =  $this->filFillList($list);
        return $data;
    }
    
    
    

    
    public function trashCount($user_id){
        $count = UserFile::model()->countBySql("select count(*) from ".Yii::app()->params['tablePrefix']."files where is_deleted=1 and user_id=".$user_id." and parent_file_id not in (select id from ".Yii::app()->params['tablePrefix']."files where is_deleted=1 and user_id=".$user_id.")");
        return $count;
    }
}
?>